package com.sfc.spiderweb.service;

import com.alibaba.fastjson.JSON;
import com.ebay.eis.dto.responses.FetchTokenResponses;
import com.eis.client.ApiException;
import com.eis.client.api.OAuthApi;
import com.sfc.spiderweb.entity.po.spider.AmazonBillDataJp;
import com.sfc.spiderweb.util.AmountUtils;
import com.sfc.spiderweb.util.DesUtil;
import com.sfc.spiderweb.util.FileUtil;
import org.springframework.util.CollectionUtils;

import java.io.File;
import java.util.*;

public class Test {

    private final static String[] repaceString = {":", "：", "\\.", "。"};

    public static void main(String[] args) throws Exception{
        /*String s = "D0C9E7DFE86EEEA25745F4A3B7EF8826";
        System.out.println(DesUtil.decrypt(s));*/
        /*String s1 = "7 For All Mankind Seven For All Mankind";
        String s2 = "7 For All Mankind Seven For All Mankind";
        //(?i)
        String rex = "\\b" + s2 + "\\b";
        String[] split = s2.split(rex);
        for (String s : split) {
            System.out.println(s);
        }
        System.out.println(split[0]);
        System.out.println(s1.matches(split[0]));
        Pattern pattern = Pattern.compile(rex);

        Matcher matcher = pattern.matcher(s1);
        System.out.println(matcher.matches());
        String[] result = pattern.split(s2);

        for (String string : result) {
            System.out.println("分割的字符串:" + "[" + string + "]");
        }*/
        /*System.out.println(s2.matches(".*\\b(?i)" + s1 + "\\b.*"));*/
        /*String text = "Description:  Colour : Black.。  Cable material : Nylon  Cable Length : 36mm  Ball Diameter: Approx 30mm  For  VW Golf 6 MK6 Golf GTI R20.  Package Includes:  2 Pieces Car Trunk Rope：VOLKSWAGEN Strap";
        for (String s : repaceString) {
            text = text.replaceAll(s, " ");
        }
        System.out.println(text);*/

        /*String s1 = "-ANTIBACTÉRIEN SUPÉRIEUR: après un traitement technologique spécial, il peut empêcher efficacement la reproduction des  apportées par la poussière humide";
        String s2 = "antibactérien";
        System.out.println(s1.toLowerCase().matches(".*\\b" + s2.toLowerCase() + "\\b.*"));*/
        /*String pwd1 = "aufowedo568#";
        System.out.println(DesUtil.encrypt(pwd1));*/
        //String url = "http://123.58.44.234:6888/shr/shr/msf/service.do?method=callService&serviceName=inteOAGetAdminOrgDataService";
        /*String urls = "http://123.58.44.234:6888/shr/shr/msf/service.do?method=callService&serviceName=inteOAGetAdminOrgDataService";
        String s = HttpClient.doGet(urls);*/
        /*File file = new File("D:\\财务\\lazada活动报名");
        File[] files = file.listFiles();
        for (File file1 : files) {
            while (file1.getName().endsWith("xls")){
                FileUtil.isFileWriting(file1.getAbsolutePath());
                System.out.println("1");
                Thread.sleep(2000);
            }
        }*/
        /*System.out.println(System.getProperty("user.dir"));*/
        /*List<List<String>> list = new ArrayList<>();
        list.add(Arrays.asList("1","2","3","4","5"));
        list.add(Arrays.asList("10","20","30","40","50"));
        list.add(Arrays.asList("100","200","300","400","500"));
        for (List<String> strings : list) {
            Map<String,String> map = new HashMap<>();
            map.put("column1","1");
            map.put("column2","2");
            map.put("column3","3");
            map.put("column4","4");
            map.put("column5","5");
            AmazonBillDataJp o = JSON.parseObject(JSON.toJSONString(map), AmazonBillDataJp.class);
            System.out.println(o);
        }*/
        /*String account = "2 349,60";
        String s = AmountUtils.formatAmount(account);
        System.out.println(s);*/
        /*Map<String,List<String>> map = new HashMap<>();
        map.put("1",Arrays.asList("A","B"));
        map.put("2",Arrays.asList("C","D"));
        map.put("1",Arrays.asList("E"));
        System.out.println(map);*/
        String account = "201,09";
        System.out.println(AmountUtils.formatAmount(account));
    }

}
